package com.example.controller;

import com.example.pojo.ResumeClassify;
import com.example.service.IResumeClassifyService;
import com.example.vo.ResultVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 简历信息分类表 前端控制器
 * </p>
 *
 * @author wsl
 * @since 2022-04-14
 */
@RestController
@RequestMapping("/resumeClassify")
@Api(tags = "简历信息分类表",value = "")
@CrossOrigin(allowCredentials = "true")
public class ResumeClassifyController {

    @Autowired
    private IResumeClassifyService ircs;

    @GetMapping("/handle-entry")
    @ApiOperation(value = "查询已录用但未入职的员工简历")
    public ResultVo getHireNotYetEntryResume(){
        return ircs.getHireNotYetEntryResume();
    }

    @GetMapping("/selid/{rid}")
    @ApiOperation("根据id编辑简历")
    public List<Map<String, Object>> rcSelById(@PathVariable Integer rid){
        return ircs.selRescById(rid);
    }

    @PutMapping("/uptresc")
    @ApiOperation("根据id修改简历分类")
    public ResultVo rescUpt(@RequestBody ResumeClassify resumeClassify){
        Integer resc = ircs.uptResc(resumeClassify);
        if (resc > 0){
            return ResultVo.ok();
        }
        return ResultVo.error("简历分类修改失败！");
    }
}
